/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package livraria.database;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author Ivanovikjch
 */
public abstract class Conexao {
    private static final String DBLOC = "jdbc:mysql://localhost:3306/livraria";
    private static final String DBUSER = "root";
    private static final String DBPASS = "3664126355";
    private static Connection con;
    
    public static Connection conecta() throws SQLException{
        if (con == null || con.isClosed()) {
         con = DriverManager.getConnection(DBLOC,DBUSER,DBPASS);
        }
      return con;
    }
}
